﻿// Write a program that concatenates two text files into another text file.

using System;
using System.IO;

class ConcatenateTwoTextFile
{
    static void Main()
    {
        string path = @"..\..\";
        string file1 = Path.Combine(path, "input1.txt");
        string file2 = Path.Combine(path, "input2.txt");

        string outputPath = Path.Combine(path, "output.txt");
        using (var outputFile = File.Create(outputPath))
        {
            foreach (var file in new[] { file1, file2 })
            {
                using (var inputFile = File.OpenRead(file))
                {
                    inputFile.CopyTo(outputFile);
                }
            }
            Console.WriteLine("File {0} and {1} are combined in file {2}.", file1, file2, outputPath);
        }
    }
}